#ifndef _MAN_INPUT_H_
#define _MAN_INPUT_H_


#include <termio.h>
#include <stdio.h>
#include <thread>

#define MAN_LEFT 68
#define MAN_RIGHT 67
#define MAN_UP 65
#define MAN_DOWN 66
#define MAN_QUIT 113
#define MAN_ENTER 10
#define MAN_PAS 112
#define MAN_ERR 101

using namespace std;

class ManInput {
public:
	ManInput(int (*callback)(int,void *,bool *),void * data);
	~ManInput();
	void loop();
	static int scanKeyboard();
	static int getChar();
private:
	static void threadFunc(ManInput* ptr);
	int (*m_callback)(int,void *,bool *);
	void * m_data;
	thread m_thread;
	bool m_quit;
};

#endif
